package com.yp.infrastructure.demo.config.axon;


import com.yp.infrastructure.demo.PartnerAggregate;
import org.axonframework.eventsourcing.EventSourcingRepository;
import org.axonframework.eventsourcing.eventstore.EventStore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
public class PartnerAxonConfiguration {


    @Resource
    private EventStore eventStore;

    @Bean
    public EventSourcingRepository<PartnerAggregate> addressEventSourcingRepository() {
        return EventSourcingRepository.builder(PartnerAggregate.class).eventStore(eventStore).build();
    }
}
